<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;


// 无需校验token
Route::group('/api', function () {
    Route::get('/index', [app\controller\IndexController::class,'index']);
    Route::post('/login', [app\controller\LoginController::class,'index']);
});


Route::group('/api/user', function () {
    Route::get('/index', [app\controller\UserController::class,'get_user_info']);// 用户信息
    Route::get('/websocket', [app\controller\UserController::class,'websocket']);// websocket
    Route::get('/backpack', [app\controller\UserController::class,'backpack']);// 背包
    Route::post('/upload_voice', [app\controller\UserController::class,'upload_voice']);// 上传语音
    Route::post('/change_score', [app\controller\UserController::class,'change_score']);// 修改积分
    Route::post('/update_nickname', [app\controller\UserController::class,'update_nickname']);// 修改昵称
    Route::post('/modify_problem_answer', [app\controller\UserController::class,'modify_problem_answer']);// 修改问题和答案
});

//---------------------------游戏好友------------------------------------//
Route::group('/api/friend',function (){
    Route::get('/stranger_list', [app\controller\UserFriendController::class,'stranger_list']);//获取陌生人列表
    Route::get('/ship_list', [app\controller\UserFriendController::class,'ship_list']);//获取好友关系列表
    Route::get('/request_list', [app\controller\UserFriendController::class,'request_list']);//获取好友请求列表
    Route::get('/search', [app\controller\UserFriendController::class,'search']);//搜索
    Route::post('/add', [app\controller\UserFriendController::class,'add']);//添加
    Route::post('/verify', [app\controller\UserFriendController::class,'verify']);//验证
    Route::post('/bind_ship', [app\controller\UserFriendController::class,'bind_ship']);//绑定关系
});



Route::group('/api/pet', function () {
    Route::get('/list', [app\controller\PetController::class,'list']);// 宠物列表
});


Route::group('/api/shop', function () {
    Route::get('/list', [app\controller\ShopController::class,'list']);// 商店列表
    Route::post('/buy', [app\controller\ShopController::class,'buy']);// 购买商品
});

Route::group('/api/user_pet', function () {
    Route::get('/list', [app\controller\UserPetController::class,'list']);// 用户宠物列表
    Route::post('/exchange', [app\controller\UserPetController::class,'exchange']);// 兑换宠物
    Route::post('/set_name', [app\controller\UserPetController::class,'set_name']);// 设置宠物名称和称谓
    Route::post('/feed', [app\controller\UserPetController::class,'feed']);// 喂养宠物
});
